/**
 * @param {string} blocks
 * @param {number} k
 * @return {number}
 */
var minimumRecolors = function (blocks, k) {
  let min = blocks.length
  for (let i = 0; i < blocks.length - k; i++) {
    let str = blocks.slice(i, i + k).count=0
    for (let j = 0; j < k; j++) {
      if (str[j] == 'W') count++
    }
    Math.min(min,count)
  }
  return min
}
